package com.yunmai11.yunmai.fragment;

import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;

import com.yunmai11.yunmai.R;
import com.yunmai11.yunmai.activity.OrderListActivity;
import com.yunmai11.yunmai.activity.WaterActivity;

/**
 * Created by Administrator on 2017/1/15.
 */
public class UCFragment extends BaseFragment implements View.OnClickListener {

    @Override
    protected View initView() {
        View view = LayoutInflater.from(mContext).inflate(R.layout.uc_fragment, null);
        init(view);
        return view;
    }

    @Override
    protected void initData() {
        super.initData();
    }

    private void init(View view) {
        Button btn_order_list = (Button) view.findViewById(R.id.btn_order_list);
        Button btn_address = (Button) view.findViewById(R.id.btn_address);
        btn_order_list.setOnClickListener(this);
        btn_address.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_order_list:
                Intent olIntent = new Intent(getActivity(), OrderListActivity.class);
                startActivity(olIntent);
                break;
            case R.id.btn_address:
                Intent waterIntent = new Intent(getActivity(), WaterActivity.class);
                startActivity(waterIntent);
                break;
        }
    }
}
